import Vue from 'vue'
import VueRouter from "vue-router";
import Layout from "@/views/layout.vue"
import Article from "@/views/article.vue"
import Like from "@/views/like.vue"
import Collect from "@/views/collect.vue"
import User from "@/views/user.vue"
import axios from "axios"
import ArticleDetailPage from "@/views/article-detail.vue"
Vue.use(VueRouter)
axios.defaults.baseURL="https://mock.boxuegu.com"
Vue.prototype.$ajax=axios
const router = new VueRouter({
  routes: [
    {
      path: '/',
      component: Layout,
      redirect:"/article",
      children: [
        { path: 'article', component: Article },
        { path: 'like', component: Like },
        { path: 'collect', component: Collect },
        { path: 'user', component: User },
      ]
    },
    {path:'/article-detail/:id',component:ArticleDetailPage}
  ]
})

export default router